home *** CD-ROM | disk | FTP | other *** search
- Path: news.internex.net.au!usenet
- From: sultan@connexus.apana.org.au (Jon Hornstein)
- Newsgroups: comp.lang.c++
- Subject: Re: Would/Won't you use a garbage collector?
- Date: Fri, 12 Apr 1996 09:15:26 GMT
- Organization: connexus.apana.org.au
- Message-ID: <4kjbeq$36u@preeda.internex.net.au>
- References: <4kamie$e4d@dfw-ixnews3.ix.netcom.com>
- NNTP-Posting-Host: dialin-4.internex.net.au
- X-Newsreader: Forte Free Agent 1.0.82
-
- I don't use Garbage Collector(GC) but I would love to use them.
-
- Why because...
-
- Basically I want it part of the "standard" function library or even
- integrated into the language.
-
- Generally one memory leak or g-d forbid a dandling pointer in
- production code would more than justify the expense of buying 3rd
- party software to facilitate GC.
-
- GC must be flexible ie TOTALLY configurable due to the different
- environments it will execute on, and be very efficient!
-
- The general C/C++ programming model assumes a certain paradyn ie.
- stack based, separated Data and address space. I've written programs
- that assume no explicit heap (embedded controllers) or the old "hello
- world\n" program. With no heap I generally don't care about GC.
-
- I know different software houses produce GC packages targetted for
- particular platforms but because I write code for
- DOS\OS/2\Solaris\Embedded controllers I would like to take the GC
- package and that hard learned experience across to all these
- platforms.
-
-
- I hate having to allocate and deallocate heap objects. So called
- "smart" pointers or "reference" counting can releave some of the
- tedium but are clearly not the only answer, they're only my stopgap
- measure to releave some of the coding "burden".
-
- Strategies for GC have been around for 30 years yet not incorporated
- into C/C++ standards.
-
- I've read quotes in ads. with astounding claims re. memory leaks fixes
- and performance/productivity enhancements.
-
- Let us say I believe the ads, then you can assume I'm crying out to
- ANSI standards comittees or compiler vendors well what are we waiting
- for.
-
- I have't the time to implement my own version of GC nor should an
- application programmer be expected to produce such a facility. Such a
- facillity is not trivial to implement and perhaps would introduce more
- bugs in the systems I write.
-
- When vendors like for example Rogue Wave, or ObjectSpace lend there
- support to GC then I think GC will become a reality for me.
-
- Please indicate "packages" I can use for GC commercial or otherwise
- because I am very interested in improving my accuracy and productivity
- not for this project, but for the next!
-
- Please mail to me where I can get GC packages. Thanks in advance!
-
-
- Yours Jon
-
-
- giuliano@ix.netcom.com(Giuliano Carlini) wrote:
-
- >I'm a long time proponent of using garbage collection in C and C++
- >programs, and I'm curious:
- > - How many others are there?
- > - Why don't most C/C++ programmers use it?
- >I'm particularly interested in finding out why most C/C++ don't use it.
- >While I have my own theories - which I'll describe below - I'm
- >interested
- >in finding out more directly from those who are against it. I've spent
- >a
- >good part of the past 4 years trying to convince people to use it, and
- >I've got a handle on why the small group of people I associate with are
- >not using it, but I'd like to find out more about why the C/C++
- >community
- >as a whole does not.
-
- >I hope that with this information, I'll be able to perfect a more
- >convincing presentation for why the default should be to use garbage
- >collection, and for why explicit calls to free/delete should be used
- >only
- >in the rare cases for which garbage collection is inappropriate.
-
- >What follows is my belief for why garbage collection is so little used.
- >Feel free to respond to anything I say below, but please, first respond
- >to the questions above. I believe that most people don't use garbage
- >collection because either they:
- > - don't know what it is
- > - don't know it can be used with C/C++.
- > - are misinformation
- > - are biased against it by the C/C++ culture
- >In my experience, most C/C++ programmers either don't know what garbage
- >collection is, or don't know that it can be used with C/C++. After all,
- >no major C/C++ compiler includes a garbage collector. At least, as far
- >as I know. I hope I'm wrong, and that someone can correct me. But even
- >after, I tell them what it is, and that it can be used with C++, almost
- >everyone still rejects it.
-
- >At first, most offer technical reasons for rejecting it. Almost all are
- >based on misinformation, since garbage collection is usable and
- >benificial
- >for the vast majority of systems. The most often mentioned is thatFrom: giuliano@ix.netcom.com(Giuliano Carlini)
- >Newsgroups: comp.lang.c++
- >Subject: Would/Won't you use a garbage collector?
-
- >I'm a long time proponent of using garbage collection in C and C++
- >programs, and I'm curious:
- > - How many others are there?
- > - Why don't most C/C++ programmers use it?
- >I'm particularly interested in finding out why most C/C++ don't use it.
- >While I have my own theories - which I'll describe below - I'm
- >interested
- >in finding out more directly from those who are against it. I've spent
- >a
- >good part of the past 4 years trying to convince people to use it, and
- >I've got a handle on why the small group of people I associate with are
- >not using it, but I'd like to find out more about why the C/C++
- >community
- >as a whole does not.
-
- >I hope that with this information, I'll be able to perfect a more
- >convincing presentation for why the default should be to use garbage
- >collection, and for why explicit calls to free/delete should be used
- >only
- >in the rare cases for which garbage collection is inappropriate.
-
- >What follows is my belief for why garbage collection is so little used.
- >Feel free to respond to anything I say below, but please, first respond
- >to the questions above. I believe that most people don't use garbage
- >collection because either they:
- > - don't know what it is
- > - don't know it can be used with C/C++.
- > - are misinformation
- > - are biased against it by the C/C++ culture
- >In my experience, most C/C++ programmers either don't know what garbage
- >collection is, or don't know that it can be used with C/C++. After all,
- >no major C/C++ compiler includes a garbage collector. At least, as far
- >as I know. I hope I'm wrong, and that someone can correct me. But even
- >after, I tell them what it is, and that it can be used with C++, almost
- >everyone still rejects it.
-
- >At first, most offer technical reasons for rejecting it. Almost all are
- >based on misinformation, since garbage collection is usable and
- >benificial
- >for the vast majority of systems. The most often mentioned is thatalthough
- >I sure try. The crux of cultural reason against garbage collection is
- >that
- >relying on a garbage collector is "sloppy". The "Code talk" note in the
- >January Byte is a great example of this thinking. This sort of C/C++
- >programmer believes that it is just wrong to not explicitly call
- >delete.
- >That if you don't, your an undisciplined hack. That if you don't,
- >you've
- >turned to the dark side and surely will come to a bad end.
-
- >I'm not sure how to address this. My current argument seems to get them
- >thinking, but isn't immediately convincing. Anyone have any ideas on a
- >better approach. Or perhaps on a better presentation. My argument is
- >that
- >computers are very good at mechanistic, repetitive tasks. And that
- >people
- >are usually pretty bad at them; being mechanistic and repetitive, these
- >tasks are rather boring, which means that our attention often strays.
- >People
- >routinely turn over such tasks to computers. For example, bookkeeping
- >or
- >inventory control. And what else is memory deallocation but a sort of
- >bookkeeping or inventory control. It's just that rather than being for
- >a resource outside of the computer it is for one inside.
-
- >For anyone who may be wondering, I believe that we should use garbage
- >collection because:
- > - It vastly decreases the number of bugs in programs which use
- >it.
- > - It vastly decreases the time to complete programs which use
- >it.
- > - It vastly increases the understandability, reuseability,
- > extensability, and maintainability of programs which use
- >it.
-
- >So, do you use garbage collection in your C/C++ programs, and if not,
- >why not?
-
- >giuliano
-
-
-